From: Tim Deegan Date: Thu, 30 Jun 2011 09:26:54 +0000 (+0100) Subject: Nested p2m: flush only one p2m table when reallocating. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10093 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=625df8ad2faa686ed9665b45bbebb0fcd0f90103;p=xen.git Nested p2m: flush only one p2m table when reallocating. It's unhelpful to flush all of them when we only need one. Reported-by: Christoph Egger Signed-off-by: Tim Deegan Acked-by: Christoph Egger --- diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index a74dd37e77..e9cd4fc51d 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -1120,7 +1120,6 @@ p2m_get_nestedp2m(struct vcpu *v, uint64_t cr3) volatile struct nestedvcpu *nv = &vcpu_nestedhvm(v); struct domain *d; struct p2m_domain *p2m; - int i; /* Mask out low bits; this avoids collisions with CR3_EADDR */ cr3 &= ~(0xfffull); @@ -1146,12 +1145,9 @@ p2m_get_nestedp2m(struct vcpu *v, uint64_t cr3) } /* All p2m's are or were in use. Take the least recent used one, - * flush it and reuse. - */ - for (i = 0; i < MAX_NESTEDP2M; i++) { - p2m = p2m_getlru_nestedp2m(d, NULL); - p2m_flush_locked(p2m); - } + * flush it and reuse. */ + p2m = p2m_getlru_nestedp2m(d, NULL); + p2m_flush_locked(p2m); nv->nv_p2m = p2m; p2m->cr3 = cr3; nv->nv_flushp2m = 0;